<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of DecimalFormat
 *
 * @author acer
 * Tested in 25.12.2011 15:26
 */
class DecimalFormat {
    //put your code here
    
    protected $_pattern;
    
    function __construct($pattern) {
        $this->_pattern = $pattern;
    }
    
    public function format($number) {
        $float_count = strlen($this->_pattern) - strrpos($this->_pattern, ".") - 1;
        return number_format($number, $float_count, '.', '');
    }
    
}